unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

  function strSEHistGramProcess(strdata : PChar;lngdatalen,typhistgraminfo,typhisgram : Integer;strtempfile,strfilename : string):Integer; external 'GramSave.dll' ;
  function strScatGramProcess(strdata : PChar;lngdatalen : Integer;strtempfile,strfilename : string):Integer; external 'GramSave.dll' ;


  {
 integer strUFHistGramProcess (ref string strdata,long lngdatalen,long lngx,long lngy,ref string strtempfile,ref string strfilename) LIBRARY "GramSave.dll"
  integer strKHistGramProcess (ref string strdata,long lngdatalen,typhistgraminfo typhisgram,ref string strtempfile,ref string strfilename) LIBRARY "GramSave.dll"
  integer strUFScatGramProcess (ref string strdata,long lngdatalen,long lngx,long lngy,ref string strtempfile,ref string strfilename) LIBRARY "GramSave.dll"
  integer strSEHistGramProcess (ref string strdata,long lngdatalen,typhistgraminfo typhisgram,string strtempfile,string strfilename) LIBRARY "GramSave.dll"
  integer strScatGramProcess (ref string strdata,long lngdatalen,string strtempfile,string strfilename) LIBRARY "GramSave.dll"
  integer strHistGramProcess (ref string strdata,long lngdatalen,typhistgraminfo typhisgram,string strtempfile,string strfilename) LIBRARY "GramSave.dll"
  integer MakeGif (string strbmp,string strgif,string strdata) LIBRARY "G7.dll"
  integer intSetBackgroundColor (string strgirfilename,integer inttype) LIBRARY "GramSave.dll"
}
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  strdata : PChar;
  lngdatalen,typhistgraminfo,typhisgram,iret : Integer;
  strtempfile,strfilename : string;
begin
  strdata := PChar('D3U SERBCDISCRI050255000212000060049006300000000000200030002000100010001000100020'+
              '003000800210049009901670214022501890133007700390022001300080006000'+
              '600050005000600070007000800090007000700060004000300020001000000000000000000000000000000000000');


              
  lngdatalen := Length(strdata)+1;
  typhistgraminfo := 2;
  typhisgram := 2;
  strtempfile := 'c:\strtempfile';
  strfilename := 'c:\strfilename.bmp';
//  iret := strSEHistGramProcess(strdata,lngdatalen,typhistgraminfo,typhisgram,strtempfile,strfilename);
  iret := strScatGramProcess(strdata,lngdatalen,strtempfile,strfilename);
  Memo1.Lines.Add(IntToStr(iret));
end;

end.
